from src.handler.buff import BuffHandler

class Buff:
    
    name = "buff"
    
    def __init__(self):
        self.lifetime = 0
        self.age = 0
        self.addEffect()
        self.entity = None
            
    def addEffect(self):
        pass
    
    def doEffect(self):
        pass
    
    def removeEffect(self):
        pass
    
    def readFromPSO(self, pso):
        self.age = pso.get("age")
        self.name = pso.type
        
    @staticmethod
    def loadFromPSO(pso):
        buff = BuffHandler.get(pso.type)
        buff.readFromPSO(pso)
        return buff
        
    def writeToPSO(self, pso):
        pso.set("age", self.age)
        pso.type = self.name